Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
The figures npm package provides a set of unicode symbols with fallbacks to ASCII characters for better compatibility across different platforms. It allows developers to enhance the visual appeal and readability of their console output without worrying about cross-platform issues.
Cross-platform symbols
This feature allows the use of symbols like ticks and crosses, with automatic fallbacks to simpler ASCII characters on platforms that do not support the more complex unicode symbols. The code sample demonstrates how to use the tick and cross symbols.
"use strict";\nconst figures = require('figures');\nconsole.log(figures.tick, figures.cross);
Customizable symbol fallbacks
Developers can customize the fallbacks for symbols, providing an alternative character for environments that do not support the default unicode symbol. This code sample shows how to replace the default tick symbol with a custom character.
"use strict";\nconst figures = require('figures');\nfigures.replace({ tick: '√' });\nconsole.log(figures.tick);
Chalk is a popular npm package for styling terminal strings. While it focuses on adding color and style to text, figures focuses on providing cross-platform symbols. Both packages enhance the visual output of console applications but in different aspects.
The emoji package allows for the inclusion of emojis in Node.js applications. Similar to figures, it enhances the visual aspect of console output but does so through emojis rather than symbols. Figures provides a more subtle way of enhancing output with symbols that have fallbacks for better compatibility.
Unicode symbols with Windows CMD fallbacks
Windows CMD only supports a limited character set.
$ npm install figures
See the source for supported symbols.
const figures = require('figures');
console.log(figures('✔︎ check'));
// On non-Windows OSes: ✔︎ check
// On Windows: √ check
console.log(figures.tick);
// On non-Windows OSes: ✔︎
// On Windows: √
console.log(figures.main.tick);
// On all OSes: ✔︎
console.log(figures.windows.tick);
// On all OSes: √
Returns the input with replaced fallback Unicode symbols on Windows.
All the below figures are attached to the main export as shown in the example above.
Type: string
String where the Unicode symbols will be replaced with fallback symbols depending on the OS.
Symbols to use when not running on Windows.
Symbols to use when running on Windows.
Name | Non-Windows | Windows |
---|---|---|
tick | ✔ | √ |
cross | ✖ | × |
star | ★ | * |
square | ▇ | █ |
squareSmall | ◻ | [ ] |
squareSmallFilled | ◼ | [█] |
play | ▶ | ► |
circle | ◯ | ( ) |
circleFilled | ◉ | (*) |
circleDotted | ◌ | ( ) |
circleDouble | ◎ | ( ) |
circleCircle | ⓞ | (○) |
circleCross | ⓧ | (×) |
circlePipe | Ⓘ | (│) |
circleQuestionMark | ?⃝ | (?) |
bullet | ● | * |
dot | ․ | . |
line | ─ | ─ |
ellipsis | … | ... |
pointer | ❯ | > |
pointerSmall | › | » |
info | ℹ | i |
warning | ⚠ | ‼ |
hamburger | ☰ | ≡ |
smiley | ㋡ | ☺ |
mustache | ෴ | ┌─┐ |
heart | ♥ | ♥ |
nodejs | ⬢ | ♦ |
arrowUp | ↑ | ↑ |
arrowDown | ↓ | ↓ |
arrowLeft | ← | ← |
arrowRight | → | → |
radioOn | ◉ | (*) |
radioOff | ◯ | ( ) |
checkboxOn | ☒ | [×] |
checkboxOff | ☐ | [ ] |
checkboxCircleOn | ⓧ | (×) |
checkboxCircleOff | Ⓘ | ( ) |
questionMarkPrefix | ?⃝ | ? |
oneHalf | ½ | 1/2 |
oneThird | ⅓ | 1/3 |
oneQuarter | ¼ | 1/4 |
oneFifth | ⅕ | 1/5 |
oneSixth | ⅙ | 1/6 |
oneSeventh | ⅐ | 1/7 |
oneEighth | ⅛ | 1/8 |
oneNinth | ⅑ | 1/9 |
oneTenth | ⅒ | 1/10 |
twoThirds | ⅔ | 2/3 |
twoFifths | ⅖ | 2/5 |
threeQuarters | ¾ | 3/4 |
threeFifths | ⅗ | 3/5 |
threeEighths | ⅜ | 3/8 |
fourFifths | ⅘ | 4/5 |
fiveSixths | ⅚ | 5/6 |
fiveEighths | ⅝ | 5/8 |
sevenEighths | ⅞ | 7/8 |
FAQs
Unicode symbols with fallbacks for older terminals
The npm package figures receives a total of 28,300,083 weekly downloads. As such, figures popularity was classified as popular.
We found that figures demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.